package com.bonc.apim.constant;

/**
 * API审核系统定义常量
 * @author wishes
 */
public class BaseConstant {
	
	/** 0  订阅审批：API正在审核中  发布审批：流程创建，正在审核中*/
	public static final int API_APPROVING = 0;
	
	/** 1  订阅审批：API流程审核通过  发布审批：流程审核完成*/
	public static final int API_APPROVED_PASS = 1;
	
	/** 2  订阅审批：API流程审核不通过  发布审批：一级审核不通过*/
	public static final int API_APPROVED_NOPASS = 2;

	/** 3  发布审批：一级审核通过*/
	public static final int API_APPROVED_LEVEL_A_PASS = 3;

	/** 4  发布审批：二级审核不通过*/
	public static final int API_APPROVED_LEVEL_B_NOPASS = 4;

	/** 5  发布审批：二级审核通过*/
	public static final int API_APPROVED_LEVEL_B_PASS = 5;

	/** 系统提示信息 0 流程未启动成功 */
	public static final int RETURN_CODE_ERROR=0;
	
	/** 系统提示信息 1 流程启动成功 */
	public static final int RETURN_CODE_OK=1;

	/** 系统提示信息 2 API订阅审批流程已存在 */
	public static final int RETURN_CODE_EXISTED=2;

	/** 审批意见 1 同意 pass */
	public static final int APPROVAL_PASS = 1;
	
	/** 审批意见 0 不同意 nopass */
	public static final int APPROVAL_NOPASS = 0;

	public static final int getPassConstant(String levelNum){
		int result = -1;
		int num = Integer.valueOf(levelNum);
		switch (num){
			case 1:
				result = API_APPROVED_LEVEL_A_PASS;
                break;
			case 2:
				result = API_APPROVED_LEVEL_B_PASS;
                break;
		}
		return result;
	}

	public static final int getNoPassConstant(String levelNum){
		int result = -1;
        int num = Integer.valueOf(levelNum);
		switch (num){
			case 1:
				result = API_APPROVED_NOPASS;
                break;
			case 2:
				result = API_APPROVED_LEVEL_B_NOPASS;
                break;
		}
		return result;
	}
}
